package situ;

import org.apache.ibatis.annotations.Mapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;

@SpringBootApplication
@Configuration //表示这个java类就是以前的 applicationContext.xml了
public class Springboot01Application {
@Autowired
    ResourceLoader loader;

    public static void main(String[] args) {
        SpringApplication.run(Springboot01Application.class, args);
    }

//<bean 改为 方法
//    @Bean
//    public PropertyPlaceholderConfigurer propertyPlaceholderConfigurer(){
//        PropertyPlaceholderConfigurer p=new PropertyPlaceholderConfigurer();
//
//        p.setLocations(loader.getResource("classpath:jdbc.properties") );
//
//        return p;
//    }
}
